package com.yanq.liancar.adapter;

import android.support.annotation.Nullable;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.yanq.liancar.R;
import com.yanq.liancar.bean.QueryBalanceByUserBean;

import java.util.List;

public class SmallBPriceDetailedAdapter extends BaseQuickAdapter<QueryBalanceByUserBean.DataBean.RecordBean, BaseViewHolder> {
    public SmallBPriceDetailedAdapter(int layoutResId, @Nullable List<QueryBalanceByUserBean.DataBean.RecordBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, QueryBalanceByUserBean.DataBean.RecordBean item) {
        helper.setText(R.id.tv_time, item.getPayTime())
                .setText(R.id.tv_name, item.getConsumDesc());

        TextView tv_price=helper.getView(R.id.tv_price);
                if ("1".equals(item.getType())){
                    tv_price.setTextColor(mContext.getResources().getColor(R.color.main_color));
                    tv_price.setText("+"+item.getPayMoney());
                }else {
                    tv_price.setTextColor(mContext.getResources().getColor(R.color.red));
                    tv_price.setText("-"+item.getPayMoney());
                }

        //        if ("1".equals(item.getType())){
        //            tv_name.setText("精准洗车");
        //        }else if ("2".equals(item.getType())){
        //            tv_name.setText("标准洗车");
        //        }else if ("3".equals(item.getType())){
        //            tv_name.setText("美容养护");
        //        }else if ("4".equals(item.getType())){
        //            tv_name.setText("到店保养");
        //        }else if ("5".equals(item.getType())){
        //            tv_name.setText("钣金喷漆");
        //        }else if ("6".equals(item.getType())){
        //            tv_name.setText("代办服务");
        //        }else {
        //            tv_name.setText("全车打蜡");
        //        }
    }
}
